Repository navigation
fix(workspace): keep the shown tiles still when a tile before them is removed - #281
Merged
Merged
Conversation
… removed Removing a tile before the leading one shown pulled every shown tile back one slot: they slid to their new slot while the row scrolled after them on another curve, so the shown tile wobbled (or slid out, with several tiles shown). The workspace now moves its leading tile back with the removal, and the row's view, its selection indicator and the tiles jump together, so nothing on screen moves.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Removing a tile placed before the leading tile shown (off screen, to the left) pulled every shown tile back one slot. Each tile slid to its new slot while the row scrolled after it on a different curve, so the shown tile wobbled; with several tiles shown, the row did not scroll and the shown tiles slid out instead.
Fix
The removal is treated as the view moving back with the tiles:
WorkspaceState.removeWindowmovesfirstVisibleIndexback by one when the removed tile was before it.SlidingContainerjumps its scroll offset and selection indicator whenfirstVisibleIndexchanges from outside (not from its own report).TileDropSlottakes aviewShift, applied once with the change of window list, so the tiles jump with the view instead of sliding; freshly built tiles start at their shifted slot.Tests
test/tile_removal_before_view_test.dartchecks, frame by frame, that the shown tiles do not move when a tile before them is removed, with one and with two tiles shown. Both fail without the fix.